<?php

function date_to_stamp( $date, $slash_time = true, $timezone = 'Europe/London', $expression = "#^\d{2}([^\d]*)\d{2}([^\d]*)\d{4}$#is" ) {
    $return = false;
    $_timezone = date_default_timezone_get();
    date_default_timezone_set( $timezone );
    if( preg_match( $expression, $date, $matches ) )
        $return = date( "Y-m-d " . ( $slash_time ? '00:00:00' : "h:i:s" ), strtotime( str_replace( array($matches[1], $matches[2]), '-', $date ) . ' ' . date("h:i:s") ) );
    date_default_timezone_set( $_timezone );
    return $return;
}

function convertir_fecha($date){
    $año = substr($date, 8,4);
    $mes = substr($date,5,2);
    $dia = substr($date,2,2);
    $fecha = $año."-".$mes."-".$dia;
    return $fecha;
}

function formato_fecha($date){
    $fecha = substr($date, 2,10);
    return $fecha;
}
?>
